package com.gosophia.dataDictionary.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.commons.web.logAnnotation.LogRecord;
import com.gosophia.dataDictionary.dto.DataValueDTO;
import com.gosophia.dataDictionary.ws.DataDictionaryWebService;

/**
 * 移动数据值
 * @author tianchunyu
 *
 */
@Controller
@Scope("prototype")
public class MoveDataValueAction extends BaseAjaxAction<DataValueDTO> {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Override
    public DataValueDTO getDetailData() {
        if (this.detailData == null) {
            this.detailData = new DataValueDTO();
        }
        return this.detailData;
    }

    @Autowired
    private DataDictionaryWebService dataDictionaryWebService;
    
    private Long toId;
    
    @Override
    public String _execute() throws Exception {
        dataDictionaryWebService.moveDataValue(this.detailData.getDataValueId(), toId, this.detailData.getEntryId());
        super.getRequestResult().setRsltCode("0");
        return SUCCESS;
    }

    public Long getToId() {
        return toId;
    }

    public void setToId(Long toId) {
        this.toId = toId;
    }
}
